﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

	<Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Rectangle Fill="Transparent"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="HorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Height" Value="22"/>
		<Setter Property="Width" Value="11"/>
		<Setter Property="Foreground" Value="Gray"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Grid SnapsToDevicePixels="true">
						<Rectangle x:Name="thumb" Fill="{DynamicResource CbrBackgroundNormal}"
								   Stroke="White" StrokeThickness="1"/>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Fill" TargetName="thumb" Value="{DynamicResource CbrBackgroundSelected}"/>
							<Setter Property="Stroke" TargetName="thumb" Value="{DynamicResource CbrBorderBrushSelected}"/>
						</Trigger>
						<Trigger Property="IsDragging" Value="true">
							<Setter Property="Fill" TargetName="thumb" Value="{DynamicResource CbrBackgroundSelected}"/>
							<Setter Property="Stroke" TargetName="thumb" Value="{DynamicResource CbrBorderBrushSelected}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Fill" TargetName="thumb" Value="{DynamicResource CbrBackgroundDisabledBrush}"/>
							<Setter Property="Stroke" TargetName="thumb" Value="{DynamicResource CbrBackgroundDisabledBrush}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="CbrSlider" TargetType="{x:Type Slider}">
		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="#FFC4C4C4"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Slider}">
					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<Border x:Name="TrackBackground" 
								BorderBrush="{DynamicResource CbrBackgroundNormal}" BorderThickness="1" 
									Background="{DynamicResource CbrBackgroundNormal}" CornerRadius="1" Height="4.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center">
								<Canvas Margin="-6,-1">
									<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Visibility="Hidden"/>
								</Canvas>
							</Border>
							<Track x:Name="PART_Track" Grid.Row="1">
								<Track.DecreaseRepeatButton>
									<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
								</Track.DecreaseRepeatButton>
								<Track.IncreaseRepeatButton>
									<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
								</Track.IncreaseRepeatButton>
								<Track.Thumb>
									<Thumb x:Name="Thumb" Style="{StaticResource HorizontalSliderThumbStyle}"/>
								</Track.Thumb>
							</Track>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsSelectionRangeEnabled" Value="true">
							<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
						</Trigger>
						<Trigger Property="IsKeyboardFocused" Value="true">
							<Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<!--<Style.Triggers>
			<Trigger Property="Orientation" Value="Vertical">
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type Slider}">
							<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto"/>
										<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
										<ColumnDefinition Width="Auto"/>
									</Grid.ColumnDefinitions>
									<Border x:Name="TrackBackground" 
											BorderBrush="{DynamicResource CbrBackgroundNormal}" BorderThickness="1" 
											Background="{DynamicResource CbrBackgroundNormal}" Grid.Column="1" CornerRadius="1" HorizontalAlignment="center" Margin="0,5" Width="5">
										<Canvas Margin="-1,-6">
											<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Visibility="Hidden" Width="4.0"/>
										</Canvas>
									</Border>
									<Track x:Name="PART_Track" Grid.Column="1">
										<Track.DecreaseRepeatButton>
											<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
										</Track.DecreaseRepeatButton>
										<Track.IncreaseRepeatButton>
											<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
										</Track.IncreaseRepeatButton>
										<Track.Thumb>
											<Thumb x:Name="Thumb" Style="{StaticResource VerticalSliderThumbStyle}"/>
										</Track.Thumb>
									</Track>
								</Grid>
							</Border>
							<ControlTemplate.Triggers>
								<Trigger Property="IsSelectionRangeEnabled" Value="true">
									<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
								</Trigger>
								<Trigger Property="IsKeyboardFocused" Value="true">
									<Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>-->
	</Style>

</ResourceDictionary>